<template>
  <div class="my">
<van-action-sheet
  v-model="show"
  :actions="actions"
  cancel-text="取消"
  close-on-click-action
/>
  </div>
</template>

<script>
import { mapState, mapGetters, mapActions } from "vuex";
import wx from "weixin-js-sdk";
import Vue from "vue";
Vue.config.ignoredElements = ['wx-open-launch-weapp']

export default {
  head() {
    return {
      show: true,
      actions: [{ name: '选项一' }, { name: '选项二' }, { name: '选项三' }],
    };
  },
  data() {
    return {};
  },

  components: {},
  computed: {
    ...mapGetters({
      userInfo: "authen/userInfo",
    }),
    ...mapState({
      // pointInfo: (state) => state.point.pointInfo,
    }),
  },
  created() {
    // this.goto()
  },
  mounted() {
    // var btn = document.getElementById("launch-btn");
    // btn.addEventListener("launch", function (e) {
    //   console.log("success");
    // });
    // btn.addEventListener("error", function (e) {
    //   alert("小程序打开失败");
    //   console.log("fail", e.detail);
    // });
    // const uni = this.unionId
  },
  methods: {
    ...mapActions({
      getSdkConfig: "authen/getSdkConfig",
    }),
    goto(){
      this.getSdkConfig({
        jsApiList:[
          'wx-open-launch-weapp',
        ],
        openTagList: ["wx-open-launch-weapp"] 
          }).then((res) => {
          wx.config(res);
          wx.ready(function (res) {
            console.log(res);
          });
          wx.error(function (res) {
            alert("拉取微信Sdk配置出错");
          });
        });
       
    }
  },
};
</script>

<style lang="scss">
.my {
  padding: 0.2rem;
  padding-bottom: 0;
  width: 100vw;
  box-sizing: border-box;
  .top {
    background-color: #2c2d30;
    height: 4.7rem;
    overflow: hidden;
    .vip {
      background-color: #fbdc95;
      width: 95%;
      margin: 0 auto;
      height: 3rem;
      margin-top: 0.5rem;
      padding: 0.2rem 0.3rem;
      box-sizing: border-box;
      border-radius: 0.3rem 0.3rem 0 0;
      position: relative;
      > .con {
        //background-color: rgb(148, 84, 84);
        height: 100%;
        position: relative;
        .header {
          width: 1.3rem;
          height: 1.4rem;
          text-align: center;
          display: flex;
          flex-direction: column;
          justify-content: space-between;
          align-items: center;
          .avatar {
            width: 1rem;
            height: 1rem;
            background: #000;
            border-radius: 0.5rem;
          }
          .name {
            font-size: 0.2rem;
            color: #7c6c43;
          }
        }
        .grade {
          width: 2.4rem;
          position: absolute;
          left: 1.5rem;
          top: 0;
          .title {
            color: #483c22;
            font-size: 0.32rem;
            // font-weight:bold;
          }
          .progress {
            width: 2.4rem;
            height: 4px;
            border-radius: 2px;
            margin: 0 auto;
            margin-top: 0.2rem;
            background-color: #deb46d;
            .value {
              width: 1rem;
              height: 3px;
              background-color: #fff6e7;
            }
          }
          .text {
            margin-top: 0.1rem;
            font-size: 12px;
            text-align: right;
            color: #cc9a54;
          }
        }
        .scan {
          width: 0.8rem;
          height: 0.8rem;
          position: absolute;
          right: 0.1rem;
          top: 0.2rem;
          background: url("../../static/vip/scan2.png") no-repeat 0 0;
          background-size: 100% 100%;
        }
        .no {
          color: #da9e4f;
          font-size: 0.35rem;
          text-align: center;
          position: absolute;
          width: 100%;
          bottom: 0.2rem;
        }
      }
    }
    .cont {
      color: #92964f;
      //background-color: #ebd8ae;
      display: flex;
      justify-content: space-around;
      text-align: center;
      height: 1.2rem;
      .item {
        display: flex;
        justify-content: space-around;
        text-align: center;
        flex-direction: column;
        color: #90954e;

        .amount {
          height: 0.6rem;
          font-size: 0.3rem;
          font-weight: bolder;
          line-height: 0.6rem;
        }
        .text {
          height: 0.4rem;
          font-size: 0.21rem;
          line-height: 0.3rem;
        }
      }
      .line {
        width: 1px;
        height: 0.7rem;
        margin-top: 0.2rem;
        background-color: #dbdbdb;
      }
    }
  }
  .bottom {
    width: 100%;
    margin-top: 0.2rem;
    > .title {
      color: #404040;
      font-weight: bolder;
      font-size: 0.28rem;
    }
    > .cont {
      height: 5rem;
      width: 6.8rem;
      margin: 0 auto;
      margin-top: 0.4rem;
      //background-color:#f4cf89;
      display: flex;
      flex-wrap: wrap;
      // justify-content: space-between;
      align-content: space-between;
      //align-content:flex-start;

      .item {
        width: 31%;
        height: 1.5rem;
        //background-color:#c2af8d;
        display: flex;
        justify-content: space-around;
        flex-direction: column;
        align-items: center;
        border: 1px solid #f0f0f0;

        .icon {
          width: 0.39rem;
          height: 0.39rem;
          background-color: rgba(240, 210, 153, 100);
          background-size: 100% 100%;
        }
        .text {
          text-align: center;
          left: 0.56rem;
          height: 0.32rem;
          color: rgba(87, 87, 87, 100);
          font-size: 0.21rem;
          text-align: center;
          font-weight: bold;
          font-family: SourceHanSansSC-regular;
        }
      }
      .item:not(:nth-child(3n)) {
        margin-right: calc(6.3% / 3);
      }
      .item:nth-child(1) {
        .icon {
          background: url("../../static/vip/a1.svg") no-repeat 0 0;
          background-size: 100% 100%;
        }
      }
      .item:nth-child(2) {
        .icon {
          background: url("../../static/vip/a2.svg") no-repeat 0 0;
          background-size: 100% 100%;
        }
      }
      .item:nth-child(3) {
        .icon {
          background: url("../../static/vip/a3.svg") no-repeat 0 0;
          background-size: 100% 100%;
        }
      }
      .item:nth-child(4) {
        .icon {
          background: url("../../static/vip/a4.svg") no-repeat 0 0;
          background-size: 100% 100%;
        }
      }
      .item:nth-child(5) {
        .icon {
          background: url("../../static/vip/a5.svg") no-repeat 0 0;
          background-size: 100% 100%;
        }
      }
      .item:nth-child(6) {
        .icon {
          background: url("../../static/vip/a6.svg") no-repeat 0 0;
          background-size: 100% 100%;
        }
      }
      .item:nth-child(7) {
        .icon {
          background: url("../../static/vip/a7.svg") no-repeat 0 0;
          background-size: 100% 100%;
        }
      }
      .item:nth-child(8) {
        .icon {
          background: url("../../static/vip/a8.svg") no-repeat 0 0;
          background-size: 100% 100%;
        }
      }
    }
  }
}
</style>
